From: robertl Date: Mon, 21 Jun 2010 03:45:10 +0000 (+0000) Subject: Constant string thrashing for Windows version check. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~16^2~49 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=a8665c78a1cf863b5c058fef0b5cd77d233bf70f;p=gpsbabel.git Constant string thrashing for Windows version check. --- diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 33f8be382..14bbd1c39 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: mainwindow.cpp,v 1.22 2010/06/20 04:16:21 robertl Exp $ +// $Id: mainwindow.cpp,v 1.23 2010/06/21 03:45:10 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -60,8 +60,11 @@ QString MainWindow::findBabelVersion() QString str = babel.readAll(); is_beta = str.contains("-beta"); + str.replace("Version", ""); + str.replace("GPSBabel", ""); str.replace(QRegExp("^[\\s]*"), ""); str.replace(QRegExp("[\\s]+$"), ""); + str = str.simplified(); return str; } @@ -199,7 +202,7 @@ MainWindow::MainWindow(QWidget* parent): QMainWindow(parent) } if (!bd.ignoreVersionMismatch && babelVersion != VERSION) { - VersionMismatch vm(0, babelVersion, QString(appName) + QString(" Version " VERSION)); + VersionMismatch vm(0, babelVersion, QString(VERSION)); vm.exec(); bd.ignoreVersionMismatch = vm.neverAgain();